// 服务器全部接口返回的数据类型
export interface ResponseData {
    code: number;
    message: string;
    ok: boolean;
}

// SPU 数据的类型
export interface SpuDate {
    id?: number;
    spuName: string;
    description: string;
    tmId: number | string;
    category3Id: number | string;
    spuSaleAttrList: null | SaleAttr[]; // 销售属性
    spuImageList: null | SpuPic[]; // 照片属性
}
//
export type Records = SpuDate[];

// 获取已有的SPU接口返回的数据类型
export interface HasSpuResponseData extends ResponseData {
    data: {
        records: Records;
        total: number;
        size: number;
        current: number;
        pages: number;
        searchCount: boolean;
    };
}

// 所有品牌数据 ts 类型
export interface TradeMark {
    id: number;
    tmName: string;
    logoUrl: string;
}
export interface AllTradeMark extends ResponseData {
    data: TradeMark[];
}
//  SPU 图片数据类型
export interface SpuPic {
    id?: number;
    imgName?: string;
    imgUrl?: string;
    spuId?: number;
    createdTime?: string;
    updatedTime?: string;
    name?: string;
    url?: string;
}
export interface SpuPicData extends ResponseData {
    data: SpuPic[];
}

// SPU 销售属性数据类型
export interface SpuSaleAttr {
    id?: number | string;
    spuId?: number;
    baseSaleAttrId: number | string;
    saleAttrValueName: string;
    saleAttrName?: string;
    createdTime?: null;
    updatedTime?: null;
    isChecked?: null;
}
// 存储已有的销售属性
export type spuSaleAttrValueList = SpuSaleAttr[];
// 销售属性对象
export interface SaleAttr {
    id?: number;
    spuId?: number;
    baseSaleAttrId: number | string;
    saleAttrName: string;
    spuSaleAttrValueList: spuSaleAttrValueList;
    createdTime?: null;
    updatedTime?: null;
    flag?: boolean;
    saleAttrValue?: string;
}
export interface SaleAttrData extends ResponseData {
    data: SaleAttr[];
}

// 所有销售属性数据类型
export interface BaseSaleAttr {
    id: number;
    name: string;
}
export interface BaseSaleAttrData extends ResponseData {
    data: BaseSaleAttr[];
}

export interface skuAttr {
    attrId: number | string;
    valueId: number | string;
}
export interface skuSaleAttr {
    saleAttrId: number | string;
    saleAttrValueId: number | string;
}
// Sku 数据类型
export interface SkuData {
    category3Id: number | string;
    spuId: number | string;
    tmId: number | string;
    skuName: string;
    price: number | string;
    weight: number | string;
    skuDesc: string;
    skuAttrValueList?: skuAttr[];
    skuSaleAttrValueList?: skuSaleAttr[];
    skuDefaultImg: string;
}

// 获取 Sku 数据类型
export interface skuInfoData extends ResponseData {
    data: SkuData[];
}
